package mypro1;
/*
 * 测试while循环
 */
public class Testwhile{
    public static void main(String[] args) {
        int a = 1;
        while (a <= 100) {
            System.out.println(a);
            a++;
        }
        System.out.println("while打印结束");
        //    打印出1+2+3+...+100
        int sum = 0;
        for (int b = 1; b <= 100; b++) {
            sum = sum + b;
        }
        System.out.println("所有数的和" + sum);
    }
}
